<div class="container">
    <div class="row">
        <div class="detsoal span12">
            <h1>Edit Soal</h1>
            <fieldset>
                <legend>Keterangan Soal</legend>
                <h3>Soal: <?php echo $id_soal; ?> </h3>
            </fieldset>
            <hr />
            <?php if(validation_errors() !== ''){?>
            <div class="alert alert-block alert-error">
              <button type="button" class="close" data-dismiss="alert">&times;</button>
              <h4  class='alert-heading'>Gagal!</h4>
              <?php echo validation_errors(); ?>
            </div>
            <?php } ?>
            <?php echo form_open_multipart('guru/editdetsoalsubmit'); ?>
                <fieldset>
                    <?php echo form_hidden('id',$id); ?>
                    <legend>Pertanyaan</legend>
                    <label for="pertanyaan"></label>
                    <textarea class="span5" rows="4" name="pertanyaan"><?php echo $soal;?></textarea>
                    <label for="pertanyaanpic">Gambar Pertanyaan</label>
                    <input type="file" name="pertanyaanpic"/>
                    <?php if($gambarsoal){?>
                    <img class="span1" src="<?php echo site_url(); ?>gambarsoal/<?php echo $gambarsoal; ?>" alt="" />
                    <?php }?>
                    <?php echo form_hidden('pertanyaanpichid',$gambarsoal); ?>
                </fieldset>
                <hr />
                
                <?php 
                        switch ($this->session->userdata('opsi')) {
                            case 3:
                                ?>
                                <fieldset>
                                    <legend>Opsi 1</legend>
                                    <label for="opsi1">Opsi 1 </label>
                                    <?php if ($kunci == 1) {?>
                                    <input type="radio" name="kunci" value="1" checked />
                                    <?php } else { ?>
                                    <input type="radio" name="kunci" value="1" />
                                    <?php }?>
                                    <textarea name="opsi1" id="opsi1" class="span5" rows="4"><?php echo $opsia; ?></textarea>
                                    <label for="opsi1pic">Gambar Opsi 1</label>
                                    <input type="file" name="opsi1pic"/>
                                    <?php if($gambara){?>
                                    <img class="span1" src="<?php echo site_url(); ?>gambarsoal/<?php echo $gambara; ?>" alt="" />
                                    <?php }?>
                                    <?php echo form_hidden('opsi1pichid',$gambara); ?>
                                </fieldset>
                                <hr />
                                <fieldset>
                                    <legend> Opsi 2</legend>
                                    <label for="opsi2"> Opsi 2</label>
                                    <?php if ($kunci == 2) {?>
                                    <input type="radio" name="kunci" value="2" checked />
                                    <?php } else { ?>
                                    <input type="radio" name="kunci" value="2" />
                                    <?php }?>
                                    <textarea name="opsi2" id="opsi2" class="span5" rows="4"><?php echo $opsib; ?></textarea>
                                    <label for="opsi2pic">Gambar  Opsi 2</label>
                                    <input type="file" name="opsi2pic"/>
                                    <?php if($gambarb){?>
                                    <img class="span1" src="<?php echo site_url(); ?>gambarsoal/<?php echo $gambarb; ?>" alt="" />
                                    <?php }?>
                                    <?php echo form_hidden('opsi2pichid',$gambarb); ?>
                                </fieldset>
                                <hr />
                                <fieldset>
                                    <legend> Opsi 3</legend>
                                    <label for="opsi3"> Opsi 3</label>
                                    <?php if ($kunci == 3) {?>
                                    <input type="radio" name="kunci" value="3" checked />
                                    <?php } else { ?>
                                    <input type="radio" name="kunci" value="3" />
                                    <?php }?>
                                    <textarea name="opsi3" id="opsi3" class="span5" rows="4"><?php echo $opsic; ?></textarea>
                                    <label for="opsi3pic">Gambar  Opsi 3</label>
                                    <input type="file" name="opsi3pic"/>
                                    <?php if($gambarc){?>
                                    <img class="span1" src="<?php echo site_url(); ?>gambarsoal/<?php echo $gambarc; ?>" alt="" />
                                    <?php }?>
                                    <?php echo form_hidden('opsi3pichid',$gambarc); ?>
                                </fieldset>
                                <hr />
                                <?php
                                break;
                            case 4:?>
                                <fieldset>
                                    <legend>Opsi 1</legend>
                                    <label for="opsi1">Opsi 1 </label>
                                    <?php if ($kunci == 1) {?>
                                    <input type="radio" name="kunci" value="1" checked />
                                    <?php } else { ?>
                                    <input type="radio" name="kunci" value="1" />
                                    <?php }?>
                                    <textarea name="opsi1" id="opsi1" class="span5" rows="4"><?php echo $opsia; ?></textarea>
                                    <label for="opsi1pic">Gambar Opsi 1</label>
                                    <input type="file" name="opsi1pic"/>
                                    <?php if($gambara){?>
                                    <img class="span1" src="<?php echo site_url(); ?>gambarsoal/<?php echo $gambara; ?>" alt="" />
                                    <?php }?>
                                    <?php echo form_hidden('opsi1pichid',$gambara); ?>
                                </fieldset>
                                <hr />
                                <fieldset>
                                    <legend> Opsi 2</legend>
                                    <label for="opsi2"> Opsi 2</label>
                                    <?php if ($kunci == 2) {?>
                                    <input type="radio" name="kunci" value="2" checked />
                                    <?php } else { ?>
                                    <input type="radio" name="kunci" value="2" />
                                    <?php }?>
                                    <textarea name="opsi2" id="opsi2" class="span5" rows="4"><?php echo $opsib; ?></textarea>
                                    <label for="opsi2pic">Gambar  Opsi 2</label>
                                    <input type="file" name="opsi2pic"/>
                                    <?php if($gambarb){?>
                                    <img class="span1" src="<?php echo site_url(); ?>gambarsoal/<?php echo $gambarb; ?>" alt="" />
                                    <?php }?>
                                    <?php echo form_hidden('opsi2pichid',$gambarb); ?>
                                </fieldset>
                                <hr />
                                <fieldset>
                                    <legend> Opsi 3</legend>
                                    <label for="opsi3"> Opsi 3</label>
                                    <?php if ($kunci == 3) {?>
                                    <input type="radio" name="kunci" value="3" checked />
                                    <?php } else { ?>
                                    <input type="radio" name="kunci" value="3" />
                                    <?php }?>
                                    <textarea name="opsi3" id="opsi3" class="span5" rows="4"><?php echo $opsic; ?></textarea>
                                    <label for="opsi3pic">Gambar  Opsi 3</label>
                                    <input type="file" name="opsi3pic"/>
                                    <?php if($gambarc){?>
                                    <img class="span1" src="<?php echo site_url(); ?>gambarsoal/<?php echo $gambarc; ?>" alt="" />
                                    <?php }?>
                                    <?php echo form_hidden('opsi3pichid',$gambarc); ?>
                                </fieldset>
                                <hr />
                                <fieldset>
                                    <legend> Opsi 4</legend>
                                    <label for="opsi4"> Opsi 4</label>
                                    <?php if ($kunci == 4) {?>
                                    <input type="radio" name="kunci" value="4" checked />
                                    <?php } else { ?>
                                    <input type="radio" name="kunci" value="4" />
                                    <?php }?>
                                    <textarea name="opsi4" id="opsi4" class="span5" rows="4"><?php echo $opsic; ?></textarea>
                                    <label for="opsi4pic">Gambar  Opsi 4</label>
                                    <input type="file" name="opsi4pic"/>
                                    <?php if($gambard){?>
                                    <img class="span1" src="<?php echo site_url(); ?>gambarsoal/<?php echo $gambard; ?>" alt="" />
                                    <?php }?>
                                    <?php echo form_hidden('opsi4pichid',$gambard); ?>
                                </fieldset>
                                <hr />
                                <?php
                                break;
                            case 5:?>
                                <fieldset>
                                    <legend>Opsi 1</legend>
                                    <label for="opsi1">Opsi 1 </label>
                                    <?php if ($kunci == 1) {?>
                                    <input type="radio" name="kunci" value="1" checked />
                                    <?php } else { ?>
                                    <input type="radio" name="kunci" value="1" />
                                    <?php }?>
                                    <textarea name="opsi1" id="opsi1" class="span5" rows="4"><?php echo $opsia; ?></textarea>
                                    <label for="opsi1pic">Gambar Opsi 1</label>
                                    <input type="file" name="opsi1pic"/>
                                    <?php if($gambara){?>
                                    <img class="span1" src="<?php echo site_url(); ?>gambarsoal/<?php echo $gambara; ?>" alt="" />
                                    <?php }?>
                                    <?php echo form_hidden('opsi1pichid',$gambara); ?>
                                </fieldset>
                                <hr />
                                <fieldset>
                                    <legend> Opsi 2</legend>
                                    <label for="opsi2"> Opsi 2</label>
                                    <?php if ($kunci == 2) {?>
                                    <input type="radio" name="kunci" value="2" checked />
                                    <?php } else { ?>
                                    <input type="radio" name="kunci" value="2" />
                                    <?php }?>
                                    <textarea name="opsi2" id="opsi2" class="span5" rows="4"><?php echo $opsib; ?></textarea>
                                    <label for="opsi2pic">Gambar  Opsi 2</label>
                                    <input type="file" name="opsi2pic"/>
                                    <?php if($gambarb){?>
                                    <img class="span1" src="<?php echo site_url(); ?>gambarsoal/<?php echo $gambarb; ?>" alt="" />
                                    <?php }?>
                                    <?php echo form_hidden('opsi2pichid',$gambarb); ?>
                                </fieldset>
                                <hr />
                                <fieldset>
                                    <legend> Opsi 3</legend>
                                    <label for="opsi3"> Opsi 3</label>
                                    <?php if ($kunci == 3) {?>
                                    <input type="radio" name="kunci" value="3" checked />
                                    <?php } else { ?>
                                    <input type="radio" name="kunci" value="3" />
                                    <?php }?>
                                    <textarea name="opsi3" id="opsi3" class="span5" rows="4"><?php echo $opsic; ?></textarea>
                                    <label for="opsi3pic">Gambar  Opsi 3</label>
                                    <input type="file" name="opsi3pic"/>
                                    <?php if($gambarc){?>
                                    <img class="span1" src="<?php echo site_url(); ?>gambarsoal/<?php echo $gambarc; ?>" alt="" />
                                    <?php }?>
                                    <?php echo form_hidden('opsi3pichid',$gambarc); ?>
                                </fieldset>
                                <hr />
                                <fieldset>
                                    <legend> Opsi 4</legend>
                                    <label for="opsi4"> Opsi 4</label>
                                    <?php if ($kunci == 4) {?>
                                    <input type="radio" name="kunci" value="4" checked />
                                    <?php } else { ?>
                                    <input type="radio" name="kunci" value="4" />
                                    <?php }?>
                                    <textarea name="opsi4" id="opsi4" class="span5" rows="4"><?php echo $opsid; ?></textarea>
                                    <label for="opsi4pic">Gambar  Opsi 4</label>
                                    <input type="file" name="opsi4pic"/>
                                    <?php if($gambard){?>
                                    <img class="span1" src="<?php echo site_url(); ?>gambarsoal/<?php echo $gambard; ?>" alt="" />
                                    <?php }?>
                                    <?php echo form_hidden('opsi4pichid',$gambard); ?>
                                </fieldset>
                                <hr />
                                <fieldset>
                                    <legend> Opsi 5</legend>
                                    <label for="Opsi5"> Opsi 5</label>
                                    <?php if ($kunci == 5) {?>
                                    <input type="radio" name="kunci" value="5" checked />
                                    <?php } else { ?>
                                    <input type="radio" name="kunci" value="5" />
                                    <?php }?>
                                    <textarea name="opsi5" id="Opsi5" class="span5" rows="4"><?php echo $opsie; ?></textarea>
                                    <label for="Opsi5pic">Gambar  Opsi 5</label>
                                    <input type="file" name="Opsi5pic"/>
                                    <?php if($gambare){?>
                                    <img class="span1" src="<?php echo site_url(); ?>gambarsoal/<?php echo $gambare; ?>" alt="" />
                                    <?php }?>
                                    <?php echo form_hidden('opsi5pichid',$gambare); ?>
                                </fieldset>
                                <?php
                                break;
                        }
                ?>
                <div class="form-actions">
                  <input type="submit" class="btn btn-primary" value="Submit Soal"/>
                  <button type="reset" class="btn btn-warning">Reset Soal</button>
                </div>
            <?php echo form_close(); ?>
        </div>
    </div>
</div>